package importPool;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
//import java.util.Hashtable;
//import java.util.Stack;
import java.util.Vector;

//import dbmanager.DBManager;

public class Rate_master implements TableName
{
	private String[] str = null;
	private Vector<Object> indexVector=new Vector<Object>();
	
		
	public void initialize(String inputpath, Vector<Object> JSelectedcheck)
	{
		
		System.out.println("i m in rate master");
		RandomAccessFile file;
		try 
		{
			file = new RandomAccessFile(inputpath,"rws");
			
			
			Vector<Object> itemVector=new Vector<Object>();			
			String heading=" ";
			String itemName=" ";
			
			try 
			{
				heading=file.readLine();
				System.out.println("Heading ========="+heading);
				str=heading.split("\t");
				for(int i=0;i<JSelectedcheck.size();i++)
				{
					itemName=(String) JSelectedcheck.get(i);
					System.out.println("itemName"+itemName);
					for(int j=0;j<str.length;j++)
					{
						if(str[j].equals(itemName))
						{
							indexVector.add(j);
						}
					}
					
					itemVector.add(itemName);
				}
				System.out.println("itemVector  "+itemVector);
				System.out.println("IndexVector "+indexVector);
			
			}
			catch (IOException e1) 
			{
				e1.printStackTrace();
			}
			
		}
		catch (FileNotFoundException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		
		//RegisterRate regrate=new RegisterRate(inputpath,indexVector);
	
		String responsePath = ImportFilePath.RATERESPONSEPATH;
		@SuppressWarnings("unused")
		RegisterRate regrate=new RegisterRate(inputpath,responsePath,indexVector);
		
	}
	
}
